/* 
Scenic Graphics Library
Copyright (C) 2007 Jouni Tulkki

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USApackage scenic;
*/

package scenic;

import java.awt.Rectangle;
import java.awt.geom.AffineTransform;

/**
 * This brush paints a solid color.
 */
public class SolidColor extends Brush {
	Color color;
	
	/**
	 * Constructs a new solid color brush.
	 * 
	 * @param color the color.
	 */
	public SolidColor(Color color) {
		this.color = color;
	}

	/**
	 * Gets the color.
	 */
	public Color getColor() {
		return color;
	}
	
	/**
	 * Sets the color.
	 */
	public void setColor(Color color) {
		this.color = color;
		changed();
	}

	void draw(DrawContext context, AffineTransform transform, Rectangle visibleArea) {
		context.renderer.color(context.context, color);
		context.renderer.solidColor(context.context);
	}
}
